<!--  -->
 <template>
  <div class="el-tableList">
    <el-table :data="tableData" style="width: 100%" table>
      <el-table-column type="index" label="序号" width="100"></el-table-column>
      <el-table-column prop="address" label="地址" width="auto"></el-table-column>
      <el-table-column prop="createTime" label="创建时间" width="auto"></el-table-column>
      <el-table-column prop="shippingName" label="送货人名字" width="auto"></el-table-column>
      <el-table-column prop="shippingTel" label="送货人电话" width="auto"></el-table-column>
      <el-table-column fixed="right" label="操作" width="auto">
        <template slot-scope="scope">
          <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
// 导入的其他文件 例如：import moduleName from 'modulePath';
import { placepackList } from "@/api/user.js";
export default {
  //import所引入的组件注册
  components: {},

  data() {
    return {
      tableData: []
    };
  },

  //监听属性
  computed: {},

  //监控data中的数据变化
  watch: {},

  //方法集合
  methods: {
    sitePacking() {
      placepackList().then(res => {
        console.log(res);
        this.tableData = res.rows;
      });
    },
    handleClick(obj) {
      this.$router.push({ name: "packingDetail", query: obj });
    }
  },

  //生命周期 - 组件实例刚被创建
  beforeCreate() {},
  //创建完成 访问当前this实例
  created() {
    this.sitePacking();
  },
  //挂载之前
  beforeMount() {},
  //挂载完成 访问DOM元素
  mounted() {},
  //更新之前
  beforeUpdate() {},
  //更新之后
  updated() {},
  //for keep-alive 缓存功能，组件被激活时调用
  activated() {},
  //for keep-alive 组件被移除时调用
  deactivated() {},
  //组件销毁之前调用
  beforeDestroy() {},
  //组件销毁之后调用
  destroyed() {}
};
</script>
<style lang='scss' scoped>
.el-tableList {
  padding: 20px;
}
/* @import url(); 引入公共css类 */
</style>